import { lazy } from "react";
import {createBrowserRouter} from 'react-router-dom'
import App from "../App";
const Home=lazy(()=>import('../page/home/Index'))
const Order=lazy(()=>import('../page/order/Index'))
const Menu=lazy(()=>import('../page/menu/Index'))
export const houseroutes=[
    {
        path:'/home/order',
        element:<Order></Order>,
        title:'订单'
    },
    {
        path:'/home/menu',
        element:<Menu></Menu>,
        title:'菜单'
    }
]
const routes=createBrowserRouter([
    {
        path:'/',
        element:<App></App>,
        children:[
            {
                index:true,
                element:<Home></Home>
            },
            {
                path:'/home',
                element:<Home></Home>,
                children:houseroutes
            }
        ]
    }
])
export default routes